﻿<%@ Page Title="" MasterPageFile="~/BackOffice.master" Language="C#" AutoEventWireup="true" CodeBehind="CadastroOrcamento.aspx.cs" Inherits="MakeIT.Deo.Apresentacao.CadastroOrcamento" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<asp:Content ID="cMain" ContentPlaceHolderID="cphMain" runat="server">
    <div class="art-Block">
        <div class="art-Block-body">
            <div class="art-BlockHeader">
                <div class="l"></div>
                <div class="r"></div>
                <div class="art-header-tag-icon">
                    <div class="t">Cadastro de Or&ccedil;amentos</div>
                </div>
            </div>
            <div class="art-BlockContent">
                <div class="art-BlockContent-tl"></div>
                <div class="art-BlockContent-tr"></div>
                <div class="art-BlockContent-bl"></div>
                <div class="art-BlockContent-br"></div>
                <div class="art-BlockContent-tc"></div>
                <div class="art-BlockContent-bc"></div>
                <div class="art-BlockContent-cl"></div>
                <div class="art-BlockContent-cr"></div>
                <div class="art-BlockContent-cc"></div>
                <div class="art-BlockContent-body">

    
    <asp:UpdatePanel ID="upnOrcamento" runat="server">
        <ContentTemplate>
            <asp:TabContainer ID="tabOrcamento" runat="server" ActiveTabIndex="0">
                <asp:TabPanel ID="tabPesquisa" runat="server" HeaderText="Pesquisa">
                    <ContentTemplate>
                        <div style="width: 98%;">
                            <table style="width: 100%;">
                                <tr>
                                    <td>
                                        <asp:RadioButtonList ID="RadioButtonList2" runat="server" RepeatDirection="Horizontal">
                                            <asp:ListItem Text="Não Atendidos" Value="E" Selected="True"></asp:ListItem>
                                            <asp:ListItem Text="Atendidos" Value="D"></asp:ListItem>
                                            <asp:ListItem Text="Não finalizados pelo Cliente" Value="C"></asp:ListItem>
                                        </asp:RadioButtonList>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:Button ID="btnPesquisa" runat="server" Text="Pesquisa" OnClick="btnPesquisa_Click" />
                                        <br />
                                        <br />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:GridView ID="grvResultado" runat="server" AutoGenerateColumns="False" EmptyDataText="N&atilde;o foram encontrados registros nessa pesquisa!">
                                            <Columns>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="imgbVisualizar" runat="server" OnClick="imgbVisualizar_Click"
                                                            ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/editar.gif" CommandArgument='<%#Eval("IdOrcamento") %>' />
                                                    </ItemTemplate>
                                                    <ItemStyle HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                               
                                                <asp:BoundField DataField="IdOrcamento" HeaderText="ID"/>
                                                <asp:BoundField DataField="IdCliente" HeaderText="ID Cliente" />
                                                <asp:BoundField DataField="DataSolic" HeaderText="Solicitação" DataFormatString="{0:dd/MM/yyyy}"/>
                                                <asp:BoundField DataField="DataExec" HeaderText="Atendimento" DataFormatString="{0:dd/MM/yyyy}"/>
                                                <asp:BoundField DataField="DataValid" HeaderText="Válido até" DataFormatString="{0:dd/MM/yyyy}"/>
                                            </Columns>
                                        </asp:GridView>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="tabCadastro" runat="server" HeaderText="Cadastro">
                    <ContentTemplate>
                        <asp:Panel ID="panelCad" runat="server">
                            <div style="width: 98%;">
                                <table style="width: 100%;">
                                    
                                    <tr>
                                        <td>
                                            C&oacute;digo:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadId" runat="server" Enabled="False"></asp:TextBox> (<asp:Literal ID="ltStatus" runat="server"></asp:Literal>)
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Cliente:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadIdCliente" runat="server" Enabled="False"></asp:TextBox>
                                            <asp:TextBox ID="txtCadNomeCliente" runat="server" Enabled="False"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Solicita&ccedil;&atilde;o:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadSolic" runat="server" Enabled="False"></asp:TextBox>
                                        </td>
                                    </tr>
                                    
                                    <tr>
                                        <td>
                                            Produtos:
                                        </td>
                                        <td>
                                            <asp:GridView ID="GridViewItens" runat="server" AutoGenerateColumns="False" 
                                                Enabled="False" OnRowDataBound="GridViewItens_RowDataBound">
                                                <Columns>
                                                    <asp:BoundField DataField="IdOrcamentoItem" HeaderText="Id" />
                                                    <asp:BoundField DataField="IdProduto" HeaderText="Produto" />
                                                    <asp:BoundField DataField="Quantidade" HeaderText="Qtd." />
                                                    <asp:BoundField DataField="Quantidade" HeaderText="Emb." />
                                                    <asp:TemplateField>
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="tbVlrUnit" runat="server" Text = '<%# DataBinder.Eval(Container.DataItem, "ValorUnit").ToString()%>'></asp:TextBox>
                                                            <asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server" MaskType="Number" Mask="999,999,999.99" TargetControlID="tbVlrUnit" ClearTextOnInvalid="True">
                                                            </asp:MaskedEditExtender>
                                                        </ItemTemplate>
                                                        <HeaderTemplate>Valor Unidade</HeaderTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="ValorTotal" HeaderText="Valor Total" DataFormatString="{0:N4}"/>
                                                    <asp:TemplateField>
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="tbObs" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Obs").ToString()%>'></asp:TextBox>
                                                        </ItemTemplate>
                                                        <HeaderTemplate>Observa&ccedil;&otilde;es</HeaderTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView> 
                                            <asp:Button ID="ButtonRecalcular" runat="server" Text="Recalcular" OnClick="Recalcular" Enabled="false"/>
                                        </td>
                                    </tr>
                                    
                                    <tr>
                                        <td>
                                            Considerar or&ccedil;amento:
                                        </td>
                                        <td>
                                            <asp:CheckBox ID="cbAtendido" runat="server" Enabled="False"/> Atendido 
                                            <asp:CheckBox ID="cbEmail" runat="server" Enabled="False"/> Enviar email 
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            V&aacute;lido at&eacute;:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadValid" runat="server" Enabled="False"></asp:TextBox>
                                            <asp:ImageButton ID="imgtxtCadValid" runat="server" ImageUrl="~/App_Themes/Padrao/Imagens/backoffice/Calendario.png" />
                                            <asp:CalendarExtender ID="txtCadValid_CalendarExtender" runat="server" DaysModeTitleFormat="dd/MM/yyyy"
                                                Enabled="True" TargetControlID="txtCadValid" BehaviorID="imgtxtCadValid"
                                                PopupButtonID="imgtxtCadValid" Format="dd/MM/yyyy" TodaysDateFormat="dd/MM/yyyy" >
                                            </asp:CalendarExtender>
                                            
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Observa&ccedil;&atilde;o:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtCadObs" runat="server" Enabled="False" TextMode="MultiLine"  Rows="3" Columns="70"></asp:TextBox>
                                        </td>
                                    </tr>

                                    <tr>
                                        <td>
                                            Atendimento:
                                        </td>
                                        <td>
                                            <asp:Literal ID="ltAtendido" runat="server"></asp:Literal>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="vertical-align:top;">
                                            Atendido por:
                                        </td>
                                        <td>
                                            <asp:Literal ID="ltAtendidoPor" runat="server"></asp:Literal>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <span style="color:Red;"> (*) Campos Obrigatórios </span>
                                            <br />
                                            <br />
                                            <br />
                                            <asp:Button ID="btnSalvar" runat="server" Enabled="False" 
                                                OnClick="btnSalvar_Click" Text="Salvar"  ValidationGroup="Salvar"/>
                                            &nbsp;<asp:Button ID="btnCancelar" runat="server" OnClick="btnCancelar_Click" 
                                                Text="Cancelar" />
                                             <asp:Button ID="btnEditar" runat="server" Enabled="False" 
                                                OnClick="btnEditar_Click" Text="Editar" />
                                            &nbsp;<asp:Button ID="btnExcluir" runat="server" Enabled="False" 
                                                OnClick="btnExcluir_Click" Text="Excluir" />
                                            <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" 
                                                TargetControlID="btnExcluir" 
                                                ConfirmText="Confirma a exclus&atilde;o do or&ccedil;amento?" Enabled="True">
                                            </asp:ConfirmButtonExtender>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:TabPanel>

            </asp:TabContainer>
        </ContentTemplate>
    </asp:UpdatePanel>


                </div>
            </div>
        </div>
    </div>


</asp:Content>




